home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / skychut.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  5KB  |  181 lines

  1. /***************************************************************************
  2.   Sky Chutter By IREM
  3.  
  4.   vidhrdw.c
  5.  
  6.   Functions to emulate the video hardware of the machine.
  7.  
  8.   (c) 12/2/1998 Lee Taylor
  9.  
  10. ***************************************************************************/
  11.  
  12. #include "driver.h"
  13. #include "vidhrdw/generic.h"
  14.  
  15.  
  16. WRITE_HANDLER( skychut_vh_flipscreen_w );
  17. void skychut_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  18. WRITE_HANDLER( skychut_colorram_w );
  19. WRITE_HANDLER( skychut_vh_flipscreen_w );
  20.  
  21.  
  22. static unsigned char palette[] = /* V.V */ /* Smoothed pure colors, overlays are not so contrasted */
  23. {
  24.     0x00,0x00,0x00, /* BLACK */
  25.     0xff,0x20,0x20, /* RED */
  26.     0x20,0xff,0x20, /* GREEN */
  27.     0xff,0xff,0x20, /* YELLOW */
  28.     0x20,0xff,0xff, /* CYAN */
  29.     0xff,0x20,0xff,  /* PURPLE */
  30.     0xff,0xff,0xff /* WHITE */
  31. };
  32. static unsigned short colortable[] =
  33. {
  34.     0,1,0,2,0,3,0,4,0,5,0,6
  35. };
  36. static void init_palette(unsigned char *game_palette, unsigned short *game_colortable,const unsigned char *color_prom)
  37. {
  38.     memcpy(game_palette,palette,sizeof(palette));
  39.     memcpy(game_colortable,colortable,sizeof(colortable));
  40. }
  41.  
  42.  
  43.  
  44. static struct MemoryReadAddress skychut_readmem[] =
  45. {
  46.     { 0x0000, 0x02ff, MRA_RAM }, /* scratch ram */
  47.     { 0x1000, 0x2fff, MRA_ROM },
  48.     { 0x4000, 0x4400, MRA_RAM },
  49.     { 0x4800, 0x4bff, MRA_RAM }, /* Foreground colour  */
  50.     { 0x5000, 0x53ff, MRA_RAM }, /* BKgrnd colour ??? */
  51.     { 0xa200, 0xa200, input_port_1_r },
  52.     { 0xa300, 0xa300, input_port_0_r },
  53. //    { 0xa700, 0xa700, input_port_2_r },
  54.     { 0xfC00, 0xffff, MRA_ROM },    /* for the reset / interrupt vectors */
  55.     { -1 }    /* end of table */
  56. };
  57.  
  58.  
  59. static struct MemoryWriteAddress skychut_writemem[] =
  60. {
  61.     { 0x0000, 0x02ff, MWA_RAM },
  62.     { 0x1000, 0x2fff, MWA_ROM },
  63.     { 0x5000, 0x53ff, MWA_RAM }, /* background ????? */
  64.     { 0x4800, 0x4bff, skychut_colorram_w,&colorram }, /* foreground colour  */
  65.     { 0x4000, 0x4400, videoram_w, &videoram, &videoram_size },
  66.     { 0xa100, 0xa1ff, MWA_RAM }, /* Sound writes????? */
  67.     { 0Xa400, 0xa400, skychut_vh_flipscreen_w },
  68.     { 0xfc00, 0xffff, MWA_ROM },    /* for the reset / interrupt vectors */
  69.     { -1 }    /* end of table */
  70. };
  71.  
  72.  
  73. int skychut_interrupt(void)
  74. {
  75.     if (readinputport(2) & 1)    /* Left Coin */
  76.             return nmi_interrupt();
  77.         else
  78.             return interrupt();
  79. }
  80.  
  81.  
  82. INPUT_PORTS_START( skychut )
  83.     PORT_START
  84.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  85.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2)
  86.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  87.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL)
  88.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT  )
  89.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
  90.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_COCKTAIL )
  91.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_COCKTAIL )
  92.     PORT_START    /* IN1 */
  93.     PORT_DIPNAME(0x03, 0x00, DEF_STR( Lives ) )
  94.     PORT_DIPSETTING (   0x00, "3" )
  95.     PORT_DIPSETTING (   0x01, "4" )
  96.     PORT_DIPSETTING (   0x02, "5" )
  97.     PORT_START    /* FAKE */
  98.     PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
  99. INPUT_PORTS_END
  100.  
  101.  
  102. static struct GfxLayout charlayout =
  103. {
  104.     8,8,    /* 8*8 characters */
  105.     256,    /* 256 characters */
  106.     1,    /* 1 bits per pixel */
  107.     { 0 },
  108.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  109.     { 7, 6, 5, 4, 3, 2, 1, 0 },
  110.     8*8    /* every char takes 8 consecutive bytes */
  111. };
  112.  
  113.  
  114. static struct GfxDecodeInfo gfxdecodeinfo[] =
  115. {
  116.     { REGION_GFX1, 0x0000, &charlayout,   0, 7 },    /* 4 color codes to support midframe */
  117.     { -1 } /* end of array */
  118. };
  119.  
  120.  
  121. static struct MachineDriver machine_driver_skychut =
  122. {
  123.     /* basic machine hardware */
  124.     {
  125.         {
  126.             CPU_M6502,
  127.             20000000/8,
  128.             skychut_readmem,skychut_writemem,0,0,
  129.             skychut_interrupt,1
  130.         }
  131.     },
  132.     60, DEFAULT_60HZ_VBLANK_DURATION,       /* frames per second, vblank duration */
  133.     1,      /* single CPU, no need for interleaving */
  134.     0,
  135.  
  136.     /* video hardware */
  137.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  138.     gfxdecodeinfo,
  139.     sizeof(palette) / sizeof(palette[0]) / 3, sizeof(colortable) / sizeof(colortable[0]),
  140.     init_palette,
  141.  
  142.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  143.     0,
  144.     generic_vh_start,
  145.     generic_vh_stop,
  146.     skychut_vh_screenrefresh,
  147.  
  148.     /* sound hardware */
  149.     0,0,0,0,
  150. };
  151.  
  152.  
  153.  
  154.  
  155. /***************************************************************************
  156.  
  157.   Game driver(s)
  158.  
  159. ***************************************************************************/
  160.  
  161. ROM_START( skychut )
  162.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  163.     ROM_LOAD( "sc1d", 0x1000, 0x0400, 0x30b5ded1 )
  164.     ROM_LOAD( "sc2d", 0x1400, 0x0400, 0xfd1f4b9e )
  165.     ROM_LOAD( "sc3d", 0x1800, 0x0400, 0x67ed201e )
  166.     ROM_LOAD( "sc4d", 0x1c00, 0x0400, 0x9b23a679 )
  167.     ROM_RELOAD(               0xfc00, 0x0400 )    /* for the reset and interrupt vectors */
  168.     ROM_LOAD( "sc5a", 0x2000, 0x0400, 0x51d975e6 )
  169.     ROM_LOAD( "sc6e", 0x2400, 0x0400, 0x617f302f )
  170.     ROM_LOAD( "sc7",  0x2800, 0x0400, 0xdd4c8e1a )
  171.     ROM_LOAD( "sc8d", 0x2c00, 0x0400, 0xaca8b798 )
  172.  
  173.     ROM_REGION( 0x0800, REGION_GFX1 | REGIONFLAG_DISPOSE )
  174.     ROM_LOAD( "sc9d",  0x0000, 0x0400, 0x2101029e )
  175.     ROM_LOAD( "sc10d", 0x0400, 0x0400, 0x2f81c70c )
  176. ROM_END
  177.  
  178.  
  179.  
  180. GAMEX( 1980, skychut, 0, skychut, skychut, 0, ROT0, "Irem", "Sky Chuter", GAME_WRONG_COLORS )
  181.